<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        body{
            display: flex;
            height: 100vh;
            overflow: hidden;
            justify-content: center
        }
        .contaniner{
            display: flex;
            align-items: center;
            justify-content: center;
            width: 90vw;
            
        }
       
        .panel{
            height: 80vh;
            
            flex: 0.5;
            transition: all 700ms ease;
            margin: 10px;
            border-radius: 30px;
            background-repeat: no-repeat;
            background-position:center;
            background-size:cover ;
            cursor: pointer;
        }
        .panel.active{
            flex: 5;
        }
        /* @media(max-width:680px){
            .contaniner{
                width: 100vw;
            }
            .panel:nth-last-of-type(4),
            .panel:nth-last-of-type(5){
                display: none;
            }
        }; */
        
       
    </style>
</head>
<body>
    <div class="contaniner">
        <div class="panel" style="background-image: url(./imgs/photo_1.png);"></div>
        <div class="panel active" style="background-image: url(./imgs/photo_2.png);"></div>
        <div class="panel" style="background-image: url(./imgs/photo_3.png);"></div>
        <div class="panel" style="background-image: url(./imgs/photo_4.png);"></div>
        <div class="panel" style="background-image: url(./imgs/photo_5.png);"></div>

       
    </div>

     <script>
        const panels = document.querySelectorAll('.panel')
        panels.forEach((panel)=>{
            panel.onclick=()=>{
                removeActiveClassel();
                panel.classList.add('active');
               
            };
            function removeActiveClassel(){
                panels.forEach((panel)=>{
                    panel.classList.remove('active');
                });
            };
            
        });
     </script>
    
</body>
</html>